package com.design.facade;

/**
 * @author leali
 * @title: CipherMachine
 * @projectName design
 * @description: 数据加密类，充当子系统类
 * @date 2022/1/2 23:58
 */
public class CipherMachine {
    public String encrypt(String plainText) {
        System.out.println("数据加密，将明文转换为密文");
        StringBuilder stringBuilder = new StringBuilder();
        char[] chars = plainText.toCharArray();
        for (char ch : chars) {
            stringBuilder.append(ch % 7);
        }
        System.out.println(stringBuilder);
        return stringBuilder.toString();
    }
}
